package com.hnust.entity.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*;
import org.apache.ibatis.annotations.ConstructorArgs;

import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 创建人：zhangRuWang
 * 创建时间：2022/5/7
 * 描述：
 */
@Setter
@Getter
@NoArgsConstructor
public class CodeDto {
    private static final long serialVersionUID = 1L;
    private String id;
    private Integer type;
    private Integer code;
    private String name;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    public CodeDto(Integer code,String name){
        this.code=code;
        this.name=name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CodeDto codeDto = (CodeDto) o;
        return Objects.equals(code, codeDto.code) &&
                Objects.equals(name, codeDto.name) ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(code, name);
    }
}
